<?php defined('SEJUJOPEFDNGJSL') or exit('Access denied');?>
<?php
	$tid=checkstr($_GET['tid']);
	$query='tid='.$tid;
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<meta name="renderer" content="webkit">
<link rel="Bookmark" href="favicon.ico" >
<link rel="Shortcut Icon" href="favicon.ico" />
<script type="text/javascript" src="/public/home/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="/public/home/js/html5.js"></script>
<![endif]-->
<script type="text/javascript" src="/public/home/js/jquery.cycle.all.min.js"></script>
<link href="public/home/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="/public/home/css/H-ui.reset.css" rel="stylesheet" type="text/css" />
<link href="public/home/css/animate.css" rel="stylesheet" type="text/css" />
<link href="/public/home/css/style.css" rel="stylesheet" type="text/css" /><!--自己的样式-->
<link href="/public/home/css/plugs.css" rel="stylesheet" type="text/css" /><!--自己的样式-->
<script type="text/javascript" src="theme/js/tip.js"></script>
<script type="text/javascript" src="theme/js/checkreg.js"></script>

	<title><?php echo $GLOBALARR['sytitle']?></title>
    <meta name="Keywords" content="<?php echo $GLOBALARR['sytitle']?>">
    <meta name="Description" content="<?php echo $GLOBALARR['sytitle']?>">
</head>
<style>
    .title_login{font-size: 16px;font-weight: normal;text-align: center;margin-bottom: 18px;color:#6a6c6f;}
    .form-horizontal .form-group{margin-left:0;margin-right: 0;}
    .form-control{-webkit-box-shadow: none;box-shadow: none;border:none;border-bottom: 1px solid #eee;height: 40px;color:#55595c;}
</style>
<body >
    <div class="zhuce-box" style="height: auto;overflow: hidden;min-height: 100%;">
       <div class="w-d">
            <p class="ftpasstop">
                <img src="public/home/images/sas-logo1.png" class=" animated zoomIn">
            </p>
           <div class="zhuce mt-45 regtopbox animated flipInY" style="width:90%;max-width: 320px;padding:24px;">
                 <h3 class="title_login">用户注册</h3>
                <form id="login_info"  method="post" onsubmit="return doLogin()" class="form-horizontal">
					<input type="hidden" name="action" value="reg1" />
					<input type="hidden"  class="input-text" id="qstr" name="qstr" value="<?php echo $query; ?>"/>
					<div class="zhuce-from mt-10 rggbox" style="padding:0px;width:100%;">
                        <div class="form-group">
                            <div class="ui-sortable">
                                <input type="text" class="form-control" name="rgmobile" id="rgmobile"  placeholder="手机号码"/>
                            </div>
                        </div>
						<!-- <div class="regbox1">
						  <label>手机号码</label>
						  <input type="text" class="input-text" name="rgmobile" id="rgmobile" />
						</div> -->
                        <div class="form-group">
                            <div class="ui-sortable">
                                <div class="row">
                                    <div class="col-md-7 col-xs-7" style="margin-top: 5px;">
                                        <input type="text" class="form-control yzmput" name="pcode" id="code" placeholder="验证码" />
                                    </div>
                                    <div class="col-md-5 col-xs-5" style="margin-top: 5px;padding-left:4px;padding-right:4px;">
                                        <input type="button" value="发送验证码" id="btnSendCode" onclick="sendSms()" class="btn btn-sm" style="background-color: #3f51b5;color:#fff;line-height: 28px;width:106px;"/>
                                    </div>
                                </div>
                            </div>
                        </div>
						<!-- <div class="regbox1">
						  <label>验证码</label>
						  <input type="text" class="input-text yzmput" name="pcode" id="code" style="width: 174px;" />
						  <input type="button" value="发送验证码" id="btnSendCode" onclick="sendSms()" />
						</div> -->
                        <div class="form-group" style="margin-top: 32px;">
                            <div class="ui-sortable">
                                <input type="submit" class="denglubut" value="下一步" style="width: 100%;" />
                            </div>
                        </div>
						<!-- <div class="item mt-20">
							 <div class="left-item f-l">
								<span class="title"></span>
							 </div>
							 <div class="right-item f-l">
								<input type="submit" class="input-btn" value="下一步"/>
							 </div>
						</div> -->
					</div>
				</form>
           </div>
       </div>
	</div>
    <style type="text/css">
        .bigwid{width:96%;max-width:360px;height:360px;}
    </style>
    <div style="display:none;background-color:rgb(255,239,189)"id="rules">
		<div style="padding:10px;font-size:110%"><?php echo get_article('规章制度');?></div>
	</div>
    <div style="display:none;" id="tishi">
       <div style="padding:10px;font-size:14px;color: #888;line-height: 24px;">

       </div>
   </div>
   <script type="text/javascript" src="/public/home/js/layer/layer.js"></script>
   <script type="text/javascript">
   window.onload=function(){
    // wenxintishi();
}
   function wenxintishi(){
        layer.open({
                type: 1,
                title: ['温馨提示', 'font-size:14px;background-color:#f0f0f0;color:#999;'],
                closeBtn: 0, //不显示关闭按钮
                shift: 2,
                skin:"bigwid",
                shadeClose: true, //开启遮罩关闭
                btn: ['确定'],
                content: $('#tishi')
            });
}
    function getrules(){
	   layer.open({
			type: 1,
			title: ['规章制度', 'font-size:14px;background-color:#018101;color:#fff;'],
			area: ['800px', '600px'],
			closeBtn: 1, //不显示关闭按钮
			shift: 2,
			shadeClose: true, //开启遮罩关闭
			content: $('#rules')
		});
    }
    /**/
    function doLogin() {
		 $.ajaxSetup({
            async: false
         });

        //检测手机
    	if(!chkmobile()){
           return false;
        }
        //检测验证码是否为空
        var code=$("#code").val();
        if(code.length==0){
            layer.alert('验证码不能为空');
            return false;
        }
		var yanzhengma = /^\d{6}$/;
		if(!yanzhengma.test(code)){
			layer.alert("验证码错误！");
			return false;
		}
        var phone = $("#rgmobile").val();

         sw=false;
         //ajax判断验证码是否正确，若正确跳转到reg2
         var qstr=$("#qstr").val();
		 $.ajax({
			type: "post",
			dataType: "json",
			url: "/plus/checkreg1.php",
			data:$('#login_info').serialize(),
			success: function(data){
				if(data.res=='验证通过'){
					 layer.msg('账号检测通过，请继续');
					 sw=true;
				 }else{
					 layer.alert(data.res);
					 sw=false;
				 }
			},
			error: function(){

			},
			cache: false,
			async: false
		 });
         if(sw){
             var url='/r2.php?'+qstr;
             window.setTimeout(function(){ location.href=url; },1500);
         }
         return false;
    }

    var InterValObj; //timer变量，控制时间
    var count = 60; //间隔函数，1秒执行
    var curCount;//当前剩余秒数
    function sendSms(){
        $.ajaxSetup({
            async: false
		});
        //alert(1);
        //测手机格式
    	if(!chkmobile()){

    		layer.alert("手机格式不正确或已被使用！！");
           return false;
        }

        var phone = $("#rgmobile").val();

         //两者格式都争取情况下可发送手机验证码
    	 curCount = count;
  	　　//设置button效果，开始计时
  	     $("#btnSendCode").attr("disabled", "true");
  	     $("#btnSendCode").val("请在" + curCount + "秒内输入");
  	     InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器，1秒执行一次

		 $.ajax({
			type: "get",
			dataType: "json",
			url: "/plus/sendsms.php?phone="+phone,
			success: function(data){
				layer.alert(data.res);
			},
			error: function(){

			},
			cache: false,
			async: false
		 });
    }
    //timer处理函数
    function SetRemainTime() {
		if(curCount == 0){
          window.clearInterval(InterValObj);//停止计时器
          $("#btnSendCode").removeAttr("disabled");//启用按钮
          $("#btnSendCode").val("重新发送验证码");
		}else{
           curCount--;
           $("#btnSendCode").val("请在" + curCount + "秒内输入");
		}
    }
    </script>
    <!-- <div style="width: 100%;text-align: center;font-size: 14px;color: #413a37;margin-top:30px;">Copyright ©2016 凯莎国际 版权所有</div> -->
</body>
</html>